<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="TOKN">﻿</span><span class="COMM">/*
<span class='line'>  2</span> Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
<span class='line'>  3</span> For licensing, see LICENSE.html or http://ckeditor.com/license
<span class='line'>  4</span> */</span><span class="WHIT">
<span class='line'>  5</span>
<span class='line'>  6</span> </span><span class="COMM">/**
<span class='line'>  7</span>  * @fileOverview Defines the {@link CKEDITOR.editor} class, which is the base
<span class='line'>  8</span>  *		for other classes representing DOM objects.
<span class='line'>  9</span>  */</span><span class="WHIT">
<span class='line'> 10</span>
<span class='line'> 11</span> </span><span class="COMM">/**
<span class='line'> 12</span>  * Represents a DOM object. This class is not intended to be used directly. It
<span class='line'> 13</span>  * serves as the base class for other classes representing specific DOM
<span class='line'> 14</span>  * objects.
<span class='line'> 15</span>  * @constructor
<span class='line'> 16</span>  * @param {Object} nativeDomObject A native DOM object.
<span class='line'> 17</span>  * @augments CKEDITOR.event
<span class='line'> 18</span>  * @example
<span class='line'> 19</span>  */</span><span class="WHIT">
<span class='line'> 20</span> </span><span class="NAME">CKEDITOR.dom.domObject</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">nativeDomObject</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 21</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 22</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">nativeDomObject</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 23</span> </span><span class="WHIT">	</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 24</span> </span><span class="WHIT">		</span><span class="COMM">/**
<span class='line'> 25</span> 		 * The native DOM object represented by this class instance.
<span class='line'> 26</span> 		 * @type Object
<span class='line'> 27</span> 		 * @example
<span class='line'> 28</span> 		 * var element = new CKEDITOR.dom.element( 'span' );
<span class='line'> 29</span> 		 * alert( element.$.nodeType );  // "1"
<span class='line'> 30</span> 		 */</span><span class="WHIT">
<span class='line'> 31</span> </span><span class="WHIT">		</span><span class="NAME">this.$</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nativeDomObject</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 32</span>
<span class='line'> 33</span> </span><span class="WHIT">		</span><span class="COMM">// Get the main private function from the custom data. Create it if not</span><span class="WHIT">
<span class='line'> 34</span> </span><span class="WHIT">		</span><span class="COMM">// defined.</span><span class="WHIT">
<span class='line'> 35</span> </span><span class="WHIT">		</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">this._</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getCustomData</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="STRN">'_'</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 36</span> </span><span class="WHIT">			</span><span class="NAME">this.setCustomData</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="STRN">'_'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">this._</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 37</span>
<span class='line'> 38</span> </span><span class="WHIT">		</span><span class="COMM">// Call the base event constructor.</span><span class="WHIT">
<span class='line'> 39</span> </span><span class="WHIT">		</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">this._.events</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 40</span> </span><span class="WHIT">			</span><span class="NAME">CKEDITOR.event.call</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 41</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 42</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 43</span>
<span class='line'> 44</span> </span><span class="NAME">CKEDITOR.dom.domObject.prototype</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 45</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="WHIT">	</span><span class="COMM">// Do not define other local variables here. We want to keep the native</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="WHIT">	</span><span class="COMM">// listener closures as clean as possible.</span><span class="WHIT">
<span class='line'> 48</span>
<span class='line'> 49</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">getNativeListener</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">domObject</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">eventName</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="WHIT">	</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 51</span> </span><span class="WHIT">		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">domEvent</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT">		</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 53</span> </span><span class="WHIT">			</span><span class="NAME">domObject.fire</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">eventName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">CKEDITOR.dom.event</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">domEvent</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 54</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 56</span>
<span class='line'> 57</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="COMM">/** @lends CKEDITOR.dom.domObject.prototype */</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 58</span>
<span class='line'> 59</span> </span><span class="WHIT">		</span><span class="COMM">/** @ignore */</span><span class="WHIT">
<span class='line'> 60</span> </span><span class="WHIT">		</span><span class="NAME">on</span><span class="WHIT">  </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">eventName</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 61</span> </span><span class="WHIT">		</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 62</span> </span><span class="WHIT">			</span><span class="COMM">// We customize the "on" function here. The basic idea is that we'll have</span><span class="WHIT">
<span class='line'> 63</span> </span><span class="WHIT">			</span><span class="COMM">// only one listener for a native event, which will then call all listeners</span><span class="WHIT">
<span class='line'> 64</span> </span><span class="WHIT">			</span><span class="COMM">// set to the event.</span><span class="WHIT">
<span class='line'> 65</span>
<span class='line'> 66</span> </span><span class="WHIT">			</span><span class="COMM">// Get the listeners holder object.</span><span class="WHIT">
<span class='line'> 67</span> </span><span class="WHIT">			</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">nativeListeners</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getCustomData</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="STRN">'_cke_nativeListeners'</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">this.setCustomData</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="STRN">'_cke_nativeListeners'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 68</span>
<span class='line'> 69</span> </span><span class="WHIT">			</span><span class="COMM">// Check if we have a listener for that event.</span><span class="WHIT">
<span class='line'> 70</span> </span><span class="WHIT">			</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">nativeListeners</span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NAME">eventName</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 71</span> </span><span class="WHIT">			</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 72</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">listener</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nativeListeners</span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NAME">eventName</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">getNativeListener</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">eventName</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 73</span>
<span class='line'> 74</span> </span><span class="WHIT">				</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">this.$.addEventListener</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 75</span> </span><span class="WHIT">					</span><span class="NAME">this.$.addEventListener</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">eventName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">listener</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 76</span> </span><span class="WHIT">				</span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">this.$.attachEvent</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 77</span> </span><span class="WHIT">					</span><span class="NAME">this.$.attachEvent</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="STRN">'on'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">eventName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">listener</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 78</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 79</span>
<span class='line'> 80</span> </span><span class="WHIT">			</span><span class="COMM">// Call the original implementation.</span><span class="WHIT">
<span class='line'> 81</span> </span><span class="WHIT">			</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">CKEDITOR.event.prototype.on.apply</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 82</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 83</span>
<span class='line'> 84</span> </span><span class="WHIT">		</span><span class="COMM">/** @ignore */</span><span class="WHIT">
<span class='line'> 85</span> </span><span class="WHIT">		</span><span class="NAME">removeListener</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">eventName</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 86</span> </span><span class="WHIT">		</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 87</span> </span><span class="WHIT">			</span><span class="COMM">// Call the original implementation.</span><span class="WHIT">
<span class='line'> 88</span> </span><span class="WHIT">			</span><span class="NAME">CKEDITOR.event.prototype.removeListener.apply</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 89</span>
<span class='line'> 90</span> </span><span class="WHIT">			</span><span class="COMM">// If we don't have listeners for this event, clean the DOM up.</span><span class="WHIT">
<span class='line'> 91</span> </span><span class="WHIT">			</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">this.hasListeners</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">eventName</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 92</span> </span><span class="WHIT">			</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 93</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">nativeListeners</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getCustomData</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="STRN">'_cke_nativeListeners'</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 94</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">listener</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nativeListeners</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">nativeListeners</span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NAME">eventName</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 95</span> </span><span class="WHIT">				</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">listener</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 96</span> </span><span class="WHIT">				</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 97</span> </span><span class="WHIT">					</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">this.$.removeEventListener</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 98</span> </span><span class="WHIT">						</span><span class="NAME">this.$.removeEventListener</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">eventName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">listener</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 99</span> </span><span class="WHIT">					</span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">this.$.detachEvent</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>100</span> </span><span class="WHIT">						</span><span class="NAME">this.$.detachEvent</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">eventName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">listener</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>101</span>
<span class='line'>102</span> </span><span class="WHIT">					</span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">nativeListeners</span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NAME">eventName</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>103</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>104</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>105</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>106</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>107</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>108</span>
<span class='line'>109</span> </span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">domObjectProto</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>110</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>111</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">customData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>112</span>
<span class='line'>113</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'>114</span> 	 * Determines whether the specified object is equal to the current object.
<span class='line'>115</span> 	 * @name CKEDITOR.dom.domObject.prototype.equals
<span class='line'>116</span> 	 * @function
<span class='line'>117</span> 	 * @param {Object} object The object to compare with the current object.
<span class='line'>118</span> 	 * @returns {Boolean} "true" if the object is equal.
<span class='line'>119</span> 	 * @example
<span class='line'>120</span> 	 * var doc = new CKEDITOR.dom.document( document );
<span class='line'>121</span> 	 * alert( doc.equals( CKEDITOR.document ) );  // "true"
<span class='line'>122</span> 	 * alert( doc == CKEDITOR.document );         // "false"
<span class='line'>123</span> 	 */</span><span class="WHIT">
<span class='line'>124</span> </span><span class="WHIT">	</span><span class="NAME">domObjectProto.equals</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">object</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>125</span> </span><span class="WHIT">	</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>126</span> </span><span class="WHIT">		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">object</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">object.$</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">this.$</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>127</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>128</span>
<span class='line'>129</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'>130</span> 	 * Sets a data slot value for this object. These values are shared by all
<span class='line'>131</span> 	 * instances pointing to that same DOM object.
<span class='line'>132</span> 	 * @name CKEDITOR.dom.domObject.prototype.setCustomData
<span class='line'>133</span> 	 * @function
<span class='line'>134</span> 	 * @param {String} key A key used to identify the data slot.
<span class='line'>135</span> 	 * @param {Object} value The value to set to the data slot.
<span class='line'>136</span> 	 * @returns {CKEDITOR.dom.domObject} This DOM object instance.
<span class='line'>137</span> 	 * @see CKEDITOR.dom.domObject.prototype.getCustomData
<span class='line'>138</span> 	 * @example
<span class='line'>139</span> 	 * var element = new CKEDITOR.dom.element( 'span' );
<span class='line'>140</span> 	 * element.setCustomData( 'hasCustomData', true );
<span class='line'>141</span> 	 */</span><span class="WHIT">
<span class='line'>142</span> </span><span class="WHIT">	</span><span class="NAME">domObjectProto.setCustomData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">key</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>143</span> </span><span class="WHIT">	</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>144</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">expandoNumber</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.$._cke_expando</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">this.$._cke_expando</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">CKEDITOR.tools.getNextNumber</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>145</span> </span><span class="WHIT">			</span><span class="NAME">dataSlot</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">customData</span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NAME">expandoNumber</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">customData</span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NAME">expandoNumber</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>146</span>
<span class='line'>147</span> </span><span class="WHIT">		</span><span class="NAME">dataSlot</span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NAME">key</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>148</span>
<span class='line'>149</span> </span><span class="WHIT">		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>150</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>151</span>
<span class='line'>152</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'>153</span> 	 * Gets the value set to a data slot in this object.
<span class='line'>154</span> 	 * @name CKEDITOR.dom.domObject.prototype.getCustomData
<span class='line'>155</span> 	 * @function
<span class='line'>156</span> 	 * @param {String} key The key used to identify the data slot.
<span class='line'>157</span> 	 * @returns {Object} This value set to the data slot.
<span class='line'>158</span> 	 * @see CKEDITOR.dom.domObject.prototype.setCustomData
<span class='line'>159</span> 	 * @example
<span class='line'>160</span> 	 * var element = new CKEDITOR.dom.element( 'span' );
<span class='line'>161</span> 	 * alert( element.getCustomData( 'hasCustomData' ) );  // e.g. 'true'
<span class='line'>162</span> 	 */</span><span class="WHIT">
<span class='line'>163</span> </span><span class="WHIT">	</span><span class="NAME">domObjectProto.getCustomData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">key</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>164</span> </span><span class="WHIT">	</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>165</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">expandoNumber</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.$._cke_expando</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>166</span> </span><span class="WHIT">			</span><span class="NAME">dataSlot</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">expandoNumber</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">customData</span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NAME">expandoNumber</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>167</span>
<span class='line'>168</span> </span><span class="WHIT">		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">dataSlot</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">dataSlot</span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NAME">key</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>169</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>170</span>
<span class='line'>171</span> </span><span class="WHIT">	</span><span class="COMM">// Implement CKEDITOR.event.</span><span class="WHIT">
<span class='line'>172</span> </span><span class="WHIT">	</span><span class="NAME">CKEDITOR.event.implementOn</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">domObjectProto</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>173</span>
<span class='line'>174</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">CKEDITOR.dom.domObject.prototype</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>175</span> </span></pre></body></html>
